package com.qu.waibao.my.fragment;

import android.os.Bundle;
import android.view.View;

import com.qu.waibao.base.BaseViewPagerFragment;

/**
 * Created by Administrator on 2018/7/23.
 */

public class AcceptOrderViewPagerFragment extends BaseViewPagerFragment {
    private String type = "";
    @Override
    protected void initBundle(Bundle bundle) {
        super.initBundle(bundle);
        if(bundle != null){
            type = bundle.getString("type","more");
        }
    }

    @Override
    protected void initWidget(View root) {
        super.initWidget(root);
        if(type.equals("finished")){
            mBaseViewPager.setCurrentItem(2,true);
        }else if(type.equals("finishing")){
            mBaseViewPager.setCurrentItem(1,true);
        }
    }

    @Override
    protected PagerInfo[] getPagers() {
        return new PagerInfo[]{
            new PagerInfo("全部",AcceptOrderFragemnt.class,getBundle("全部")),
                new PagerInfo("待完成",AcceptOrderFragemnt.class,getBundle("待完成")),
                new PagerInfo("已完成",AcceptOrderFragemnt.class,getBundle("已完成"))
        };
    }

    private Bundle getBundle(String type) {
        Bundle bundle = new Bundle();
        bundle.putString("type",type);
        return bundle;
    }
}
